<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/modules/cms/front/include/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <%@include file="/WEB-INF/views/modules/cms/front/include/head.jsp" %>
    <title>用户登录</title>
    <%--    <script type="text/javascript" src="${ctxStatic}/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="${ctxStatic}/jquery-1.9.1.js/jquery-1.9.1.min.js"></script>--%>
    <%--  <link href="${ctxStatic}/jquery-validation/1.11.1/jquery.validate.min.css" type="text/css" rel="stylesheet"/>
      <script src="${ctxStatic}/jquery-validation/1.11.1/jquery.validate.min.js" type="text/javascript"></script>
      <script src="${ctxStatic}/jquery-validation/1.11.1/jquery.validate.method.min.js" type="text/javascript"></script>--%>
    <script type="text/javascript">
        /* $(document).ready(function () {
<c:if test="${not empty message}">alert("${message}");
            </c:if>
            $("#loginForm").validate({
                rules: {
                    validateCode: {remote: "${pageContext.request.contextPath}/servlet/validateCodeServlet"}
                },
                messages: {
                    loginName: {required: "请填写用户名."},
                    password: {required: "请填写密码."},
                    validateCode: {
                        remote: "验证码不正确.",
                        required: "请填写验证码."
                    }
                },
                errorContainer: "#messageBox",
                errorPlacement: function (error, element) {
                    if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
            $("#main_nav li").each(function () {
                $(this).toggleClass("active", $(this).text().indexOf('登录') >= 0);
            });
        });*/
    </script>
</head>
<body>
<div style="padding:0 0 20px;">
    <!--[if lte IE 6]><br/>
<div class='alert alert-block' style="text-align:left;padding-bottom:10px;">
    <a class="close" data-dismiss="alert">x</a><h4>温馨提示：</h4>
    <p>你使用的浏览器版本过低。为了获得更好的浏览体验，我们强烈建议您 <a href="http://browsehappy.com" target="_blank">升级</a> 到最新版本的IE浏览器，或者使用较新版本的
        Chrome、Firefox、Safari 等。</p>
</div><![endif]-->
    <form id="loginForm" class="form-signin">
        <%--<form id="loginForm" class="form-signin" action="http://localhost:8181/ccjzxyxt/a/login" method="post">--%>
        <label class="input-label" for="username">登录名</label>
        <input type="text" id="username" name="username" class="input-block-level required" value="${username}">
        <label class="input-label" for="password">密码</label>
        <input type="password" id="password" name="password" class="input-block-level required">
        <%--	<c:if test="${isValidateCodeLogin}"><div class="validateCode">
                <label class="input-label mid" for="validateCode">验证码</label>
                <sys:validateCode name="validateCode" inputCssStyle="margin-bottom:0;"/>
            </div>
            </c:if>
            <label for="mobile" title="手机登录"><input type="checkbox" id="mobileLogin" name="mobileLogin" ${mobileLogin ? 'checked' : ''}/></label> --%>
        <input type="button" class="btn btn-large btn-primary" onclick="login()" value="登 录"/>&nbsp;&nbsp;
        <input class="btn btn-large btn-primary" type="submit" value="登 录submit"/>&nbsp;&nbsp;
        <%--  <label for="rememberMe" title="下次不需要再登录">
           <input type="checkbox" id="rememberMe" name="rememberMe" ${rememberMe ? 'checked' : ''}/>记住我（公共场所慎用）</label>--%>
        <div id="themeSwitch" class="dropdown">
            <%--  <a class="dropdown-toggle" data-toggle="dropdown"
                 href="#">${fns:getDictLabel(cookie.theme.value,'theme','默认主题')}<b class="caret"></b></a>
              <ul class="dropdown-menu">
                  <c:forEach items="${fns:getDictList('theme')}" var="dict">
                      <li><a href="#"
                             onclick="location='${pageContext.request.contextPath}/theme/${dict.value}?url='+location.href">${dict.label}</a>
                      </li>
                  </c:forEach>
              </ul>--%>
            <!--[if lte IE 6]>
            <script type="text/javascript">$('#themeSwitch').hide();</script><![endif]-->
        </div>
        <div id="messageBox" class="alert alert-error" style="display:none">输入有误，请先更正。</div>
    </form>
</div>
</body>
<script>
    function login() {
        var username = "student1";
        var password = "123";
        var param = {username: username ,password: password};
        $.ajax({
            type: "post",
            url: "http://localhost:8181/ccjzxyxt/a/login",
            data: param,
            dataType: "json",
            success: function (data) {
                alert("登录成功");
            },
            error: function (data) {
                alert("err");
            }
        });
    }
</script>
</html>